#-------------------------------------------------------------------------------
# Name:        module1
# Purpose:
#
# Author:      sp41822
#
# Created:     27/03/2013
# Copyright:   (c) sp41822 2013
# Licence:     <your licence>
#-------------------------------------------------------------------------------
from PyQt4 import QtCore, QtGui
import sys

class wrk(QtCore.QThread):
    tick=QtCore.pyqtSignal(int, name="changed")
    def __init__(self):
        QtCore.QThread.__init__(self)
    def run(self):
        for progression in range(0,100):
            #self.emit(QtCore.SIGNAL("progress"), progession)
            self.tick.emit(progression)

class myui(QtGui.QWidget):
    def __init__(self):
        super(myui,self).__init__()
        self.ui()
        self.show()
    def ui(self):
        self.setGeometry(150,150,200,200)
        self.setWindowTitle("titre de la fenetre")
        self.pb=QtGui.QProgressBar(self)
        self.pb.setValue(50)
        btn=QtGui.QPushButton("GO",self)
        btn.move(0,60)
        self.connect(btn,QtCore.SIGNAL("clicked()"),self.runwrk)
    def progress(self, progression):
        self.pb.setValue(progression)
    def runwrk(self):
        self.worker=wrk()
        #self.connect(worker,QtCore.SIGNAL("progress"),self.progress)
        self.worker.tick.connect(self.progress)
        self.worker.start()

def main():
    app=QtGui.QApplication(sys.argv)
    my = myui()
    sys.exit(app.exec_())

if __name__ == '__main__':
    main()
